USE [SONALIKA_BGK_UPDATED]
GO

/****** Object:  Table [dbo].[SALES_INVOICES]    Script Date: 07-Jun-14 11:54:25 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[SALES_INVOICES](
	[SALES_INVOICE_ID] [int] IDENTITY(1,1) NOT NULL,
	[CUSTOMER_ID] [int] NOT NULL,
	[INVOICE_DATE] [datetime] NULL,
	[INVOICE_DISCOUNT] [decimal](18, 2) NULL,
	[INVOICE_GRANDTOTAL] [decimal](18, 2) NULL,
	[SELL_TYPE] [int] NOT NULL,
 CONSTRAINT [PK_SALES_INVOICES] PRIMARY KEY CLUSTERED 
(
	[SALES_INVOICE_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[SALES_INVOICES]  WITH CHECK ADD  CONSTRAINT [FK_SALES_INVOICES_CUSTOMER] FOREIGN KEY([CUSTOMER_ID])
REFERENCES [dbo].[CUSTOMER] ([CUSTOMER_ID])
GO

ALTER TABLE [dbo].[SALES_INVOICES] CHECK CONSTRAINT [FK_SALES_INVOICES_CUSTOMER]
GO

ALTER TABLE [dbo].[SALES_INVOICES]  WITH CHECK ADD  CONSTRAINT [FK_SALES_INVOICES_MASTER] FOREIGN KEY([SELL_TYPE])
REFERENCES [dbo].[MASTER] ([MASTER_ID])
GO

ALTER TABLE [dbo].[SALES_INVOICES] CHECK CONSTRAINT [FK_SALES_INVOICES_MASTER]
GO

